<template>
  <navbar :title="title" >
    
  </navbar>
  <view class="container">
    <view class="sreach">
       <u-search placeholder="关键字搜索" 
       shape="square" 
       height="80rpx"
       bg-color="#f7f7f7" 
       margin="24rpx 30rpx 26rpx 30rpx" 
       placeholderColor="#9ca3af"
       :show-action="false"
       search="handleSearch"
       v-model="question"
       >
      </u-search>
    </view>
    <view class="content">
      <view class="newPolicy" >
        <view v-for="(item ,index) in policy" :key="index">
          <view class="welPolicy">
            <view class="newsTitle">
                <view class="title" >
                {{item.title}}
                </view>
              <image src="../../static/最新政策详情ico.png" :style="{width:'12rpx',height:'21rpx'}"></image>
            </view>
            <view class="newsTime">
              <image src="../../static/最新政策时间ico.png" :style="{width:'25rpx',height:'26rpx',marginRight:'11rpx'}"></image>
              <view :style="{display:'inline-block'}">{{item.time}}</view>
            </view>
            <view class="newsDetail">
              {{item.detail}}
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
  
  <view class="subscrbe" v-if="title">
    <view class="ico">{{title.slice(0,2)}}</view>
    <view class="title">{{title}}</view>
    <view class="subInf">取消订阅</view>
  </view>
</template>

<script setup>
  import {onLoad} from '@dcloudio/uni-app'
  import { ref } from 'vue';
  import { uesNavBarStyle } from '@/utils/system';
  const title = ref('')
  const question=ref('')
  onLoad((options)=>{
   title.value=options.title? decodeURIComponent(options.title) : '';
  });
  
  const policy = ref([
    {
      title:"石家庄市2025年落户新政",
      time:"2025-05-19",
      detail:"石家庄2025年落户政策主要包括以下几类：一、人才引进落户  1. 学历型人才：全日制大专及以mmmmmmm"
    },
    {
      title:"上海市2025年落户新政",
      time:"2025-05-19",
      detail:"符合以下条件，且身体健康、无犯罪记录、在法定劳动年龄内的国内外人才，可以来上海落户"
    },
    {
      title:"邯郸市2025年落户新政",
      time:"2025-05-19",
      detail:"符合以下条件，且身体健康、无犯罪记录、在法定劳动年龄内的国内外人才，可以来邯郸落户"
    },
    {
      title:"北京市2025年落户新政",
      time:"2025-05-19",
      detail:"符合以下条件，且身体健康、无犯罪记录、在法定劳动年龄内的国内外人才，可以来北京落户"
    }
  ])
  const handleSearch=()=>{
    
  }
</script>

<style>
  .container{
    position: relative;
    padding-bottom: 100rpx;
    min-height: 100vh;
  }
  .sreach{
    border-bottom: 2rpx solid #fff6f2;
  }
  .content{
    padding: 30rpx 30rpx 100rpx 30rpx  ;
    overflow-y: auto;
    height: calc(100vh - 100rpx);
  }
  .welPolicy{
    display: flex;
    flex-direction: column;
    padding: 40rpx 30rpx 0 30rpx;
    background-color: #ffffff;
    border: 2rpx solid #eeeeee ;
    border-radius: 16rpx;
    height: 252rpx;
    margin-bottom: 4rpx ;
    width: 690rpx;
    box-sizing: border-box;
  }
  .newsTitle{
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 30rpx;
  }
    
  .newsTitle .title{
    flex: 1;
    margin-right:11rpx;
    width:600rpx;
    font-size: 30rpx;
    color: #333333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
  }
  .newsTime{
    font-size: 26rpx;
    height: 26rpx;
    align-items: center;
    color: #9ca3af;
    margin-top: 24rpx;
  }
  .newsDetail{
    margin-top: 24rpx;
    font-size: 28rpx;
    color: #4b5563;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 37rpx;
  }
  .subscrbe{
    height: 98rpx;
    bottom: 0;
    left: 0;
    right: 0;
    align-items: center;
    
    padding: 17rpx 30rpx;
    background-color: #ffffff;
    border-top: 1rpx solid #00000000;
    box-shadow: 0 -2rpx 8rpx rgba(0,0,0,0.1);
    position: fixed;
    display: flex;
    z-index: 100;
  }
  .ico{
    width: 64rpx;
    height: 64rpx;
    background-color: #e1383c;
    border-radius: 16rpx;
    color: white;
    align-items: center;
    justify-content: center;
    display: flex;
    font-size: 30rpx;
  }
  .title{
    font-size: 32rpx;
    color: #333333;
    margin-left: 16rpx;
    flex: 1;
  }
    
  .subInf{
    width: 143rpx;
    height: 54rpx;
    background-color:#fef3f3 ;
    color: #e1383c;
    border: #f9d5d5;
    font-size: 24rpx;
    border-radius: 16rpx;
    text-align: center;
    padding: 15rpx 23rpx;
    box-sizing: border-box;
  }
</style>
